
import {html} from "../html/html.js";
import {js} from "../js/js.js";
import {math} from "../math/math.js";
import {threejs} from "../js/threejs.js";
import {english} from "../english/english.js";

import {css} from "../css/index.js";

import {java} from "../java/index.js";

import {ubuntu} from "../Linux/ubuntu.js";



import {python} from "../Python/index.js";




$(function(){
  $(".xz_a").on("click",function(){
  //设置当前选择切换
  $(".xz").html($(this).html());

//传入导入模块的变量

switch ($(this).html()) {
  case "HTML":
    app(html);
    break;
    
    case "JS":
    app(js);
    break;
  
  case "CSS":
    //传入模块里的变量
    app(css);
    break;
    
    case "JAVA":
    //传入模块里的变量
    app(java);
    break;
    
    
    case "MATH":
    app(math);
    
    break;
    
   case "Ubuntu":
   app(ubuntu);
   break;
   
   case "Python":
   app(python);
   break;
    
    case "THREE":
    app(threejs);
    break;
    case "ENGLISH":
    app(english);
    break;
    /*
    case "野鸡相关":
   // app(english);
    break;
   */ 
    
  default://默认代码块以上都为false
    app("未找到相关资料...");
}



  });//on
  



 function search(str){
$(".indexof").html("");
$("p").each(function(i){
if($(this).text().indexOf(str)!=-1){
$(".indexof").append(i+".________________________________________"+$(this).text());
$(this).css({"color":"#cdcdcd","text-decoration":"line-through"});
    
}
});
}

  
  
$("#input").bind("input propertychange",function(event){
       //调用处理函数
       search($("#input").val());
});  
  
  
  
  


 
  function app(s){
 let strs= new Array(); //定义一数组 
$(".texts").html("");
  strs=s.split("#$"); //字符分割

for (let i=0;i<strs.length;i++ ) 
{ 
$(".texts").append(`<p>${strs[i]}</p>`);
}



 }//app

 if(window.Notification && Notification.permission !== "denied") {
    Notification.requestPermission(function(status) {
        var n = new Notification('通知标题', { body: '这里是通知内容！' }); 
    });
}  
    
})//$function